//
//  UIButton+Extension.swift
//  day3_weibo
//
//  Created by 王珏琨 on 16/6/15.
//  Copyright © 2016年 wangjuekun. All rights reserved.
//

import UIKit

extension UIButton {
    
    convenience init(imageName: String, backImageName: String) {
        self.init()
        
        setImage(UIImage(named: imageName), forState: UIControlState.Normal)
        setImage(UIImage(named: imageName + "_highlighted"), forState: UIControlState.Highlighted)
        
        setBackgroundImage(UIImage(named: backImageName), forState: UIControlState.Normal)
        setBackgroundImage(UIImage(named: backImageName + "_highlighted"), forState: UIControlState.Highlighted)
        
        
        sizeToFit()
    }
    
}
